﻿@inject IJSRuntime JSRuntime
@inject IChannelService ChannelService

<MList Nav Class="menu-bar-content"
       Dense>
    <div style="margin-left: 50px;">
        <MSheet Color="var(--menu-bar-content-background-color)"
                Height="160"
                Width="@("100%")">

            <span style="text-align:center;color:var(--menu-bar-content-text-color)">Gotrays Desktop</span>

            <MButton OnClick="OnGitHub" Text Block>
                GitHub<MIcon Color="#7b7e81">mdi-github</MIcon>
            </MButton>
            <span style="font-size:10px;color:var(--menu-bar-content-text-color)">
                Gotrays Desktop是一个基于Blazor的跨平台项目模板，使用MASA Blazor实现！并且实现了类Discord的布局设计！
            </span>
        </MSheet>
        <MDivider Style="background-color:#7b7e81;"></MDivider>
        <MListItemGroup @bind-Value="_selectedItem"
                        Color="primary">
            @foreach (var item in channelDtos)
            {
                <MListItem OnClick="async ()=>await OnClick.InvokeAsync(item)">
                    <MListItemIcon>
                        <MAvatar Tile Size="30">
                            <MImage Src="https://cdn.masastack.com/stack/images/website/masa-blazor/jack.png" Alt="Jack"></MImage>
                        </MAvatar>
                    </MListItemIcon>

                    <MListItemContent>
                        <MListItemTitle>
                            <span style="color:var(--menu-bar-content-text-color);">@item.Name</span>
                        </MListItemTitle>
                    </MListItemContent>
                </MListItem>
            }
        </MListItemGroup>
    </div>
</MList>